<template>

  <div class="ma">
    <div class="node" v-has="{action: 'iot:site:list', effect: 'move'}">
    <div class="search_box topSelect">
      <span class="iconfont icon-heimingdan "></span>
      <SearchInput
        placeholder="站点名称"
        label="站点名称"
        style="margin-right:20px"
        :value="searchs.name"
        :onChange="(val) => changeSearch('name',val)"
        :onBlur="getIotSite"
      />
      <SearchInput
        placeholder="联系人电话"
        label="电话"
        style="margin-right:20px"
        :value="searchs.phone"
        :onChange="(val) => changeSearch('phone',val)"
        :onBlur="getIotSite"
      />
      <div class="selectBox">
        <label>站点类型：</label>
        <el-select
          v-model="searchs.type"
          clearable
          @change="getIotSite"
          placeholder="请选择"
        >
          <el-option label="自营" :value="1"></el-option>
          <el-option label="第三方" :value="2"></el-option>
          <el-option label="租用" :value="3"></el-option>
          <el-option label="私人" :value="9"></el-option>
        </el-select>
      </div>
      <div class="selectBox">
        <label>站点状态：</label>
        <el-select
          v-model="searchs.state"
          clearable
          @change="getIotSite"
          placeholder="请选择"
        >
          <el-option label="正常" :value="1"></el-option>
          <el-option label="未启用" :value="2"></el-option>
          <el-option label="停用" :value="3"></el-option>
        </el-select>
      </div>
      <div class="selectBox">
        <el-button size="small" plain  icon="el-icon-search" @click="getIotSite">查询</el-button>        
      </div>
    </div>
    <Panel title="站点管理" :intro="intro">
      <div slot='ext' class="examine">
        <el-button size="mini" v-has="{action: 'iot:site:add', effect: 'move'}" class="button-offt" type="success" icon="el-icon-plus" @click="()=>editStore()">新增</el-button>
        <el-button size="mini" v-has="{action: 'iot:site:batch', effect: 'move'}" class="button-offt"  icon="el-icon-setting" @click="()=>batch()">批量添加枪/桩</el-button>
    </div>
    <TableEncapsulation
       slot="body"
      :tableConfig="tableConfig"
      :tableData="tableData"
    >
    <template slot="operation" slot-scope="operation">
          <el-button size="mini" icon="el-icon-edit"
            v-has="{action: 'iot:site:update', effect: 'move'}"
            @click="()=>editStore(operation.row)"
          >编辑</el-button>
          <el-button size="mini" icon="el-icon-info"
            v-has="{action: 'iot:site:update', effect: 'move'}"
            @click="()=>more(operation.row)"
          >详情</el-button>
          <el-button size="mini"
          icon="el-icon-edit"
          v-has="{action: 'iot:ext:update', effect: 'move'}"
            @click="()=>extend(operation.row)"
          >扩展信息</el-button>
        </template>
        <TablePager
          slot="pager"
          v-if="pager.use"
          :size="pager.size"
          :pageChange="pageChange"
          :show-total="pager.showTotal"
          :total="pager.total"
          :current="pager.current"
        >
          <span class="demonstration">GO></span>
        </TablePager>
    </TableEncapsulation>
    </Panel>
    </div>
    <div style="display: none;width:100%;height:100%;margin: auto;" v-has="{action: 'iot:site:list', effect: 'noPremiss'}">
      <NoPremission />
    </div>
    <!-- 站点info -->
    <ModalPanel 
      :visible='visible'
      title="站点信息"
      :onCancel="onCancel"
      class="bannerDialog"
      :showFooter="false"
      :onOk="onSubmit">
      <div>
        <div class="infoshow">
    <div class="users">
     
        <el-row>
            <el-col :span="24">
              <el-card class="box-card">
                <div class="out-box">
                  <div class="sin-box"> <span class="names">站点编码：</span><span>{{info.stationSn}}</span> </div>
                  <div class="sin-box"> <span class="names">站点类型：</span><span class="blue-tag">{{info.type == 1 ? "公共" : info.type ==50 ? "个人" : info.type ==100 ? "公交(专用)" :info.type ==101 ? "环卫(专用)" :info.type ==102 ? "物流(专用)" : info.type ==103 ? "出租车(专用)" : "其他"}}</span> </div>
                  
                  <div class="sin-box"> <span class="names">站点名字：</span><span>{{info.stationName}}</span> </div>
                  <div class="sin-box"> <span class="names">站点状态：</span><span :class="info.state == 50 ? 'agree' : info.state ==5 ? 'cancel': 'out-off'">{{info.state == 1 ? "建设中" : info.state ==5 ? "已下线": info.state ==6 ? '维护中':info.state ==50 ? '正常使用': "未知"}}</span> </div>
                  
                   <div class="sin-box"> <span class="names">接入方式：</span><span>{{info.accessWay==1? '直连':'互联互通'}}</span> </div>
                  <div class="sin-box"> <span class="names">运营商编码：</span><span>{{info.operatorSn}}</span> </div>
                 
                  <div class="sin-box"> <span class="names">服务电话：</span><span>{{info.serviceTel}}</span> </div>
                  <div class="sin-box"> <span class="names">设备所属运营商编码：</span><span>{{info.equipmentOwnerSn}}</span> </div>

                  <div class="sin-box"> <span class="names">建设场所：</span><span class="blue-tag">{{info.type == 1 ? "居民区" : info.type ==2 ? "公共机构" : info.type ==3 ? "企事业单位" :info.type ==4 ? "写字楼" :info.type ==6 ? "交通枢纽" : info.type ==7 ? "大型文体设施": info.type ==8 ? "城市绿地": info.type ==9 ? "大型建筑配建停车场": info.type ==10 ? "路边停车位": info.type ==11 ? "城际高速服务区" : "其他"}}</span> </div>

                  <div class="sin-box"> <span class="names">车位数量：</span><span>{{info.parkNums}}</span> </div>
                  <div class="sin-box"> <span class="names">经纬度：</span><span>{{info.stationLng}},{{info.stationLat}}</span> </div>
                 
                  <div class="sin-box"> <span class="names">停车费率：</span><span>{{info.parkFee}}</span> </div>
                  <div class="sin-box"> <span class="names">标签：</span><span>{{info.stationTagIds}}</span> </div>

                  <div class="sin-box"> <span class="names">省市辖区编码：</span><span>{{info.areaCode}}</span> </div>
                  <div class="sin-box"> <span class="names">地址：</span><span>{{info.address}}</span> </div>
                  <div class="sin-box"> <span class="names">占位费率：</span><span>{{info.stayFee}}</span> </div>
                  <div class="sin-box"> 
                    <span class="names">站点照片：</span>
                    <div>
                      <img src="" alt="">
                    </div>
                  </div>
                </div>
              </el-card>
                
            </el-col>
           <el-col :span="24">
              <el-card class="box-card">
                <div class="out-box1">
                  <div class="band-title">
                    <div class="line"></div>
                    <div>基本设配置</div>
                  </div>
                  <div class="btn-box">
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn"  @click="showminiRate(info.id)">小程序费率</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showParking(info.id)">关联停车场</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showParkingActive(info.id)">停车减免活动</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showParkingOutSet(info.id)">停车超时配置</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showThirdRate(info.id)">第三方费率</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showThird(info.id)">第三方公司站点映射</el-button></div>
                    <div class="btn-item"></div>
                    <div class="btn-item"></div>
                    <div class="btn-item"></div>
                  </div>
                 </div>
              </el-card>
                
            </el-col>
            <el-col :span="24">
              <el-card class="box-card">
                <div class="out-box1">
                  <div class="band-title">
                    <div class="line"></div>
                    <div>推送</div>
                  </div>
                  <div class="btn-box">
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn1" @click="publishSta(info.id)">站点推送到市政</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn1" @click="publishRatePush(info.id)">费率推送到市政</el-button></div>
                    <!-- <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn1" @click="showCompanyRate(info.id)">实时功率推送到省平台</el-button></div> -->
                  </div>
                </div>
              </el-card>
            </el-col>
            <el-col :span="24">
              <el-card class="box-card">
                <div class="out-box1">
                  <div class="band-title">
                    <div class="line"></div>
                    <div>其他功能</div>
                  </div>
                  <div class="btn-box">
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showNameList(info.id)">车辆黑名单管理</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showCompanySite(info.id)">关联集团大客户</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showCompanyRate(info.id)">关联集团费率</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showCarLog(info.id)">车辆进场记录</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="view(info)">配电设备</el-button></div>
                  </div>
                </div>
              </el-card>
            </el-col>
            <el-col :span="24">
              <el-card class="box-card">
                <div class="out-box1">
                  <div class="band-title">
                    <div class="line"></div>
                    <div>辅助设备</div>
                  </div>
                  <div class="btn-box">
                    <!-- <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showAuxiliary(info.id)">温湿度列表</el-button></div> -->
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showAuxilirayChart(info.id)">温湿度图表</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showAuxilirayRelay(info.id)">变压器管理</el-button></div>
                    <div class="btn-item"><el-button size="mini" type="primary" class="hr-btn" @click="showAuxilirayFeng(info.id)">风机管理</el-button></div>
                    
                  </div>
                </div>
              </el-card>
                
            </el-col>
        </el-row>
    </div>
  </div>
  </div>
    </ModalPanel>
    <!-- 站点info -->

    <!-- 编辑 -->
    <ModalPanel 
      :visible='add'
      title="添加/编辑"
      :showFooter='true'
      :onCancel="onCancelUpdate"
      :onOk="onSubmit">
      <div>
        <ModifyForm
          :hiddenBtn='true'
          :editColumn='editColumn'
          :updateData="updateData"
          labelWidth='100px'
          ref="configModal"
          class="ModifyForm"
          :temporaryData='modalData'>
          <!-- 站点图片 -->
          <div slot="siteImages">
              <FileUpload 
                propName='id'
                @infoData="infoData"
                @removeImage="removeImage"
                :multiple='true'
                :info='fullImage'
                :limit='8'
                :baseUrl='baseUrl'
                :postUrl='postUrl' />
          </div>
          <!-- 站点图片 end------>
          <!-- 地图 -->
          <div style="max-width:800px;min-width:400px;height:400px" slot='mapSite'>
          <base-map-search
            v-if="isSetMap"
            ref="mapSearch"
            :city="cityName"
            :value="address"
            :longitude="lng"
            :latitude="lat"
            :isEdit="isEdit"
            @updateLocation="updateLocation"
          />
        </div>
        <!-- 地图 end------>
        <!-- 标签 tag -->
        <div slot="siteBoxSlot">
          <el-checkbox-group v-model="tagIds">
            <el-checkbox  v-for="(item,index) in tagList" :key="index" :label="item.id+''">{{item.name}}</el-checkbox>
          </el-checkbox-group>
        </div>
        <!-- 省市区 -->
        <div slot='city'>
          <el-cascader
            placeholder="搜索名称"
            v-model="areaIds"
            :options="provinceList"
            :props="{children: 'areaCodeRespChildList',value: 'id',label: 'name'}"
            filterable>
          </el-cascader>
            <!-- <el-select v-model="provinceId"  placeholder="请选择省">
              <el-option
                v-for="item in province"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
            <el-select v-model="cityId"  placeholder="请选择市">
              <el-option
                v-for="item in city"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
            <el-select v-model="hid" placeholder="请选择区">
              <el-option
                v-for="item in area"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select> -->
        </div>
        <!-- 省市区 end------>
        </ModifyForm>
      </div>
    </ModalPanel>
    <!-- 编辑 -->
  </div>
</template>
<script>
import request from "@/tools/request";
import baseRequest from "@/tools/baseRequest";
import Panel from "@/components/Panel";
import TableEncapsulation from "@/components/TableEncapsulation";
import TablePager from "@/components/Pager";
import SearchInput from "@/components/SearchInput";
import ModalPanel from "@/components/ModalPanel";
import { objectFilter } from "@/tools/array";
import NoPremission from "@/components/NoPremission";
import ModifyForm from "@/components/ModifyForm";
import FileUpload from '@/components/FileUpload';
import BaseMapSearch from '@/components/map/SearMap'
export default {
  name: "sitelist",
  components: {
    TableEncapsulation,
    TablePager,
    Panel,
    SearchInput,
    ModalPanel,
    ModifyForm,
    NoPremission,
    FileUpload,
    BaseMapSearch
  },
  props: [ "isEdit", "detail"],
  data() {
    return {
     info: {},
      visible:false,
      intro:{
        title:'站点列表',
        content: `<ul><li class="ql-align-justify"><span class="ql-size-large">  所有充电站列表，自营场站是由公司运营的公共场站；私人场站为公司为用户私人车位安装充电桩。</span></li><li class="ql-align-justify"><span class="ql-size-large">“未入场是否允许充电”：公司在停车场安装的摄像头将采集入场车牌信息，若无入场纪录，用户扫码充电时将提示用户‘无入场纪录’。（此功能暂时未上线）</span></li></ul><p class="ql-align-justify"><br></p><ul><li class="ql-align-justify"><strong class="ql-size-large">操作：</strong></li></ul><ol><li class="ql-align-justify ql-indent-1"><span class="ql-size-large">添加/编辑；站点上线前请注意</span><a href="/rate/map/list" rel="noopener noreferrer" target="_blank" class="ql-size-large">配置费率</a><span class="ql-size-large">，第三方平台上线还需‘</span><a href="/third/map/list" rel="noopener noreferrer" target="_blank" class="ql-size-large">映射站点</a><span class="ql-size-large">’和‘</span><a href="/third/rate/list" rel="noopener noreferrer" target="_blank" class="ql-size-large">配置互联互通费率</a><span class="ql-size-large">’</span></li><li class="ql-align-justify ql-indent-1"><span class="ql-size-large">批量添加充电枪/桩</span></li><li class="ql-align-justify ql-indent-1"><span class="ql-size-large">充电枪管理：查看充电枪充电信息，可操作停止充电</span></li><li class="ql-align-justify ql-indent-1"><span class="ql-size-large">车辆进出场纪录（自营）：停车场摄像机拍摄的车辆信息</span></li><li class="ql-align-justify ql-indent-1"><span class="ql-size-large">配电设备（私人站）：查看站点变压器、配电箱、桩的关联信息</span></li></ol><p class="ql-align-justify"><br></p>`
      },
      tableData: [],
      searchs: {
        component: 'iotList',
        phone:'',
        state:'',
        type:'',
        name: '',
      },
       pager: {
        component: 'iotList',
        use: true,
        total: 0,
        current: 1,
        size: 10,
        showTotal: true
      },
      operation: true,
      ismOrpc: true,
      // 编辑
      tagList: [],
      tagIds: [],
      isSetMap: true,
      markers: [],
      cityName: '',
      center: [104.06, 30.67],
      zoom: 17,
      lng: 0,
      lat: 0,
      address:'',
      baseUrl: this.$baseUrl,
      postUrl: this.$baseUrl + '/file/banner',
      title:'',
      fullImage:[],
      addrPoint:{
        
      },
      pics: [],
      provinceList: [],
      areaIds: '',
      add:false,
      modalData:{},
      editColumn: [
        {
          name: "站点名称",
          prop: "stationName",
          type: "text",
          width:12,
          required: true
        }, 
        {
          name: "场站编码",
          prop: "operatorSn",
          type: "text",
          width:12,
          required: true
        }, 
        {
          name: "运营商编码",
          prop: "equipmentOwnerSn",
          type: "text",
          width:12,
          required: true
        }, 
       {
          name: "站点类型",
          prop: "stationType",
          type: "select",
          optionBindLabel: 'name',
          optionBindValue: 'id',
          optionList: [{'id': '','name': "请选择"},{'id': 1,'name': "公共"},{'id':101, 'name':"公交(专用)"},{'id':102, 'name':"物流(专用)"},{'id':103, 'name':"出租车(专用)"},{'id': 255,'name': "其他"}],
          width:12,
          required: true
        }, 
        {
          name: "服务电话",
          prop: "serviceTel",
          type: "text",
          width:12,
          required: true
        },
        {
          name: "车位数量",
          prop: "parkNums",
          type: "number",
          width:12,
          required: true
        },
        {
          name: "建设场所",
          prop: "construction",
          type: "select",
          optionBindLabel: 'name',
          optionBindValue: 'id',
          optionList: [{'id': '','name': "请选择状态"},{'id': 1,'name': "居民区"},{'id':2, 'name':"公共机构"},{'id':3, 'name':"企事业单位"},{'id':4, 'name':"写字楼"},{'id': 5,'name': "工业园区"},{'id': 6,'name': "交通枢纽"},{'id': 7,'name': "大型文体设施"},{'id': 8,'name': "城市绿地"},{'id': 9,'name': "大型建筑配建停车场"},{'id': 10,'name': "路边停车位"},{'id': 11,'name': "际高速服务区"},{'id': 255,'name': "其他"}],
          width:12,
          required: true
        },
        {
          name: "标签",
          prop: "ids",
          type: "other",
          width:24,
          required: false,
          slotName: 'siteBoxSlot',
        },
        {
          name: "停车费描述",
          prop: "parkFee",
          type: "text",
          width:24,
          required: true
        },
        {
          name: "占位费描述",
          prop: "stayFee",
          type: "text",
          width:24,
          required: true
        },
        {
          name: "站点图片",
          width: 24,
          prop: "pics",
          type: "other",
          slotName: "siteImages",
          required: false
        },
        {
          name: "区域",
          width: 24,
          prop: "hid",
          type: "other",
          slotName: "city",
          required: false
        },
        {
          name: "位置描述",
          width: 24,
          prop: "address",
          type: "text",
          required: false
        },
        {
          name: "经纬度",
          width: 24,
          prop: "address",
          type: "other",
          slotName: "mapSite",
          required: false
        },
        
      ],
    };
  },
  created() {
    
  },
  computed: {
    tableConfig () {
      return {
        selection: false,
        columnConfig: [
          {
            label: "编码",
            type: "text",
            prop: "stationSn",
            align: "center"
          },
          {
            label: "站点名称",
            type: "text",
            prop: "stationName",
            align: "center"
          },
          {
            label: "站点状态",
            type: "other",
            prop: "stationState",
            align: "center",
            fnc: val => val == 1 ? "启用" : val ==2 ? "未启用": val ==4 ? '离网': "停业",
            class:val => val == 1 ? "agree" : val == 2 ? "cancel" : val == 4 ? "out-off" : "cancel" ,
            width: 80
          },
          {
            label: "站点类型",
            type: "other",
            prop: "stationType",
            align: "center",
            fnc: val => val == 1 ? "自营" : val ==2 ? "第三方" : val ==3 ? "租用" :  "私人",
            class:val => val == 1 ? "denger-tag" : "blue-tag" ,
            width: 80
          },
          {
            label: "服务电话",
            type: "text",
            prop: "serviceTel",
            align: "center"
          },
          {
            label: "车位数量",
            type: "text",
            prop: "parkNums",
            align: "center",
            width: 70
          },
          {
            label: "详细地址",
            type: "text",
            prop: "address",
            align: "center",
            overflow: true
          },
          {
            label: "停车描述",
            type: "text",
            prop: "parkFee",
            align: "center",
            overflow: true
          },
          {
            label: "占位描述",
            type: "text",
            prop: "stayFee",
            align: "center",
            overflow: true
          },
          this.operation && {
            type: "operation",
            align: "center",
            label: "操作",
            width:280
          }
        ].filter(Boolean)
        }
    },
   
  },
  mounted(){
    this.getIotSite();
    this.getProvince()
    this.getTag()
  },
  beforeDestroy(){
    
  },
  //返回刷新列表
  activated(){
    this.getIotSite();
  },
  methods: {
    //省市区
    async getProvince() {
       let res= await request({
       url: '/manage/area/code/all',
       method: "POST",
       data:{}
     })
     if(res.code ==200){
       this.provinceList = res.data
     }
    },
    beforeRouteLeave(to, from, next) {
      console.log('beforeRouteLeave')
      to.meta.keepAlive = true;
      next(0);
    },
    searchsFnc (){
      let searchs = this.$store.getters.searchs
      if(searchs &&searchs.component == 'iotList'){
        this.searchs = searchs
      }
      let pager = this.$store.getters.pager
      if(pager &&pager.component == 'iotList'){
        this.pager = pager
      }
      if(pager &&pager.component == 'iotList'){
        this.pager = pager
      }
    },
    //获取列表
    async getIotSite() {
      let name = this.searchs.name
      let current = this.pager.current
      let size = this.pager.size
      let search = objectFilter({name, size, current})
      const res = await request({
        url: "/manage/station/query",
        method: "POST",
        data: search
      });
      this.tableData = res.data.records
      this.pager.total = res.data.total
      this.pager.current = res.data.current
    },
    pageChange(val) {
      this.pager.current = val;
      this.getIotSite();
    },
    changeSearch(key, val) {
      this.searchs[key] = val;
      this.pager.current = 1;
    },
    async more(row){
      this.info = row
      this.visible = true
    },
    onCancel(){
      this.visible = false
    },
    //添加编辑start
    infoData(data){
      this.pics = [...this.pics, this.$baseUrl+data.file]
      var pics = this.$baseUrl+data.file
      this.fullImage=[...this.fullImage, pics]
    },
    removeImage(index){
      this.fullImage.splice(index, 1)
    },
    editStore(rowData){
      if(rowData){
        this.modalData = rowData
        if(rowData.pictures !=''){
          this.fullImage =  rowData.pictures
        }
      }else{
        this.modalData ={}
      }
      this.add = true
    },
    async onSubmit(){
      this.$refs['configModal'].onSubmit()
    },
    onCancelUpdate(){
      this.add = false
    },
    async updateData(values){
      // console.log('update',this.lng,this.lat, this.fullImage, this.areaIds,this.tagIds)
      // return
      if(!this.lng || !this.lat){
        this.$message.error('请上传经纬度坐标')
        return
      }
      if(this.areaIds.length<1){
        this.$message.error('选择区域')
        return
      }
      if(this.fullImage.length<1){
        this.$message.error('请上传图片')
        return
      }
      let areaCode = this.areaIds[2]
      let stationLng = this.lng
      let stationLat = this.lat
      let pictures = this.fullImage
      let stationTagIds = this.tagIds
       let {id, operatorSn, equipmentOwnerSn, rulstationName,  address, serviceTel,stationType, parkNums, construction, parkFee, stayFee} = values
      let url = id ? "/manage/station/update": "/manage/station/add"
      let msg = id ? "编辑成功" : "添加成功"
      let res = await request({
        url: url,
        method: "POST",
        data:{id, operatorSn, equipmentOwnerSn, rulstationName,  address, serviceTel,stationType, parkNums, construction, parkFee, stayFee,areaCode, stationLng, stationLat, pictures, stationTagIds}
      })
     if(res.code !==200) return
      this.$message.success(msg)
      this.visible = false
      this.getQueryData();
    },
    async getTag(){
      let { data } = await request({ 
      url: "/manage/station/tag/select",
      method: "POST",
      data: {}
      });
      this.tagList= data
    },
    // 地图搜索选址
    updateLocation(lng, lat, address) {
      this.lng = lng;
      this.lat = lat;
      console.log('lng',lng, lat)
      this.address = address;
      // this.$emit('handelAddress', {lng, lat, address})
    },
    //添加编辑end
    //站点扩展信息
    extend(rowData){
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
      this.$router.push({ path: "/iot/site/extend",query:{id:rowData.id, siteName: rowData.name} })
    },
    view(rowData){
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
      this.$router.push({ path: "/power/pile/view",query:{id:rowData.id, sn: rowData.id,siteName: rowData.name} })
    },
    batch(){
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
      this.$router.push({ path: "/iot/site/batch"})
    },
    
    showCarLog(id){
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
      this.$router.push({ path: "/camera/carlog",query:{siteId:id} })
    },
    commentDetail(id){
      let ismOrpc =  this.$store.getters.ismOrpc
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
      if(ismOrpc){
        this.$router.push({ path: "/iot/site/gunList",query:{id:id,type: "toview"} })
      }else{
        this.$router.push({ path: "/iot/site/gunListApp",query:{id:id,type: "toview"} })
      }
    },
    pileShow(id){
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
     this.$router.push({ path: "/iot/real/pile/list",query:{id:id,type: "toview"} })
    },
    highSoc(id){
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
     this.$router.push({ path: "/iot/highSoc/info",query:{id:id,type: "toview"} })
    },
   
    //查看关联的停车场
    showParking(id){
      ///parking/index
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
      this.$router.push({ path: "/parking/index",query:{siteId:id} })
    },
    //查看停车减免
    showParkingActive(id){
      ///parking/active
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
      this.$router.push({ path: "/parking/active",query:{siteId:id} })
    },
    //查看停车超时
    showParkingOutSet(id){
      ///parking/out-set
      this.$store.commit('saveSearchs', this.searchs)
      this.$store.commit('savePager', this.pager)
      this.$router.push({ path: "/parking/out-set",query:{siteId:id} })
    },
  }
}
</script>
<style lang='scss' >
.examine{
    display: flex;
    align-items: center;
    :global{
        div{
            color: #fff;
            padding: 10px;
            margin: 0 10px;
            border-radius: 2px;
            font-size: 14px;
            cursor: pointer;
            min-width: 60px;
            text-align: center;
        }
        .adopt{
                background: #409EFF;
        }
    }
}
.search_box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
    color: #666666;

  :global {
    .el-input {
      width: 150px;
    }
    .el-select {
      .el-input {
        width: 90px;
      }
    }
    .el-input__icon {
      line-height: 27px;
    }
    .el-range-separator{
      line-height: 26px;
    }
  }
}

.topSelect {
  background-color: white;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
}

.out-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 15px;
  color: #000000;
  padding: 10px 0;
  font-size: 13px;
}
.out-box1 {
  font-size: 15px;
  color: #000000;
  padding: 10px 0;
}
.sin-box {
  min-width: 48%;
  padding: 8px 0;
  display: flex;
  align-items: center;
}
.names{
  color: rgb(153, 153, 153);
  min-width: 140px;
  text-align: right;
}
.hr-btn {
  margin: 5px auto;
  background: #fff;
  color: #409EFF;
}


.band-title{
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 18px;
}
.line{
  width: 8px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(90deg, #f94b05, #ffdcdc);
  margin-right: 3px;
}
.btn-box{
  display: flex;
  flex-wrap: wrap;
}
.btn-item {
    // margin-right: 15px;
    width: 26%;
}
.hr-btn1{
  background: #eb6028;
  border: none;
  color: #fff;
}
.el-checkbox__label{
padding-left: 4px;
}
.el-checkbox{
  margin-right: 18px;
}
</style>